<template>
  <el-dialog
    append-to-body
    :close-on-click-modal="false"
    :before-close="cancel"
    :visible.sync="visible"
    title="操舱医嘱"
    width="650px"
  >
    <div class="title">基本信息</div>
    <a-descriptions :column="4" :colon="false">
      <a-descriptions-item label="姓名">{{
        info.patientName
      }}</a-descriptions-item>
      <a-descriptions-item :label="info.patientType==1 ? '门诊号' : '住院号'">{{
        info.patientType==1 ? info.outpatientNum : info.admissionNum
      }}</a-descriptions-item>
      <a-descriptions-item label="性别">{{
        info.gender == 0 ? "女" : info.gender == 1 ? "男" : ""
      }}</a-descriptions-item>
      <a-descriptions-item label="年龄">{{ info.age }}岁</a-descriptions-item>
      <a-descriptions-item label="住址" :span="3">{{ info.addr }}</a-descriptions-item>
      <a-descriptions-item label="电话">{{
        info.phoneNum
      }}</a-descriptions-item>
      <a-descriptions-item label="门诊">{{
        info.patientType==1 ? '是' : '否'
      }}</a-descriptions-item>
      <a-descriptions-item label="床号">{{ info.bedNum }}</a-descriptions-item>
      <a-descriptions-item label="主要诊断" :span="2">{{
        info.coreDiagnosis
      }}</a-descriptions-item>
      <a-descriptions-item label="操舱注意事项">{{
        gyy.adviceNote
      }}</a-descriptions-item>
    </a-descriptions>
    <div class="title">操舱医嘱</div>
    <a-descriptions :column="4" :colon="false">
      <a-descriptions-item label="1、表压" :span="7"
        >{{ gyy.gaugePressure }}<span style="margin-left:100px">Mpa</span></a-descriptions-item
      >
      <a-descriptions-item label="2、方案" :span="7">
        <span style="margin-right: 20px"
          >单次吸氧 {{ gyy.singleOxygenMinute }}<span style="margin-left:50px">分钟</span><i class="el-icon-close" style="margin:0 10px 0 5px" />{{ gyy.singleOxygenNum }}<span style="margin-left:50px">次</span>
        </span>
        <span
          >间隔吸空气 {{ gyy.intervalOxygenMinute }}<span style="margin-left:50px">分钟</span><i class="el-icon-close" style="margin:0 10px 0 5px" />{{
            gyy.intervalOxygenNum
          }}<span style="margin-left:50px">次</span>
        </span>
      </a-descriptions-item>
      <a-descriptions-item label="3、疗程" :span="7"
        >{{ gyy.exePeriod }}<span style="margin-left:50px">次/日</span><i class="el-icon-close" style="margin:0 10px 0 5px" />{{ gyy.periodNum }}<span style="margin-left:50px">日</span></a-descriptions-item
      >
      <a-descriptions-item label="医生姓名" :span="3">{{
        gyy.doctorSign
      }}</a-descriptions-item>
      <a-descriptions-item label="申请时间" :span="3">{{
        getTime(gyy.createTime)
      }}</a-descriptions-item>
      <a-descriptions-item></a-descriptions-item>
    </a-descriptions>
  </el-dialog>
</template>

<script>
import moment from "moment";
export default {
  name: "operatingCabin",
  data() {
    return {
      visible: false,
      info: {},
      gyy: {},
    };
  },
  mounted() {},
  methods: {
    showModal(data) {
      this.visible = true;
      this.info = data.activeRow;
      this.gyy = data.activeRow2.adviceHyperbaricOxygen;
    },
    cancel() {
      this.visible = false;
    },
    getTime(val) {
      return val ? moment(val).format("YYYY-MM-DD") : "";
    },
  },
};
</script>

<style lang='scss' scoped>
.title{
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  &::before{
    margin-right: 10px;
    content: "";
    width: 4px;
    height: 23px;
    background: #169bd5;
  }
}
</style>